<template>
    <vue-office-pdf :src="'/api/file/getFile/' + fileId"  @rendered="renderedHandler" @error="errorHandler"/>
</template>

<script>
import VueOfficePdf from '@vue-office/pdf'
export default {
    name: "preview-pdf",
    props: ['fileId'],
    components: {
        VueOfficePdf
    },
    methods: {
        renderedHandler() {
            console.log("渲染完成")
        },
        errorHandler() {
            console.log("渲染失败")
        }
    }
}
</script>

<style scoped>
::v-deep .vue-office-pdf-wrapper{
    padding: 0 !important;
    background: #fff !important;
}

</style>